<!Doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>大旺福--后台管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/assets/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/assets/layui/css/global.css" media="all">
    <link rel="stylesheet" href="/assets/layui/css/login.css" media="all">
</head>
<body>
<div class="layui-layout layui-layout-admin">

    <div class="login-box">
        <div class="login-logo login-pet">
            <div class="login-pet-head">
                <div class="hand"></div>
                <div class="hand"></div>
                <div class="arms">
                    <div class="arm"></div>
                    <div class="arm"></div>
                </div>
            </div>
        </div>
        <div class="login-box-body">
            <p class="login-box-msg">登录开始您的会话</p>
            <form class="layui-form">
                <div class="layui-form-item">
                    <input type="text" class="layui-input" name="username" lay-verify="username" placeholder="用户名" />
                </div>
                <div class="layui-form-item">
                    <input type="password" class="layui-input" name="password" lay-verify="password" placeholder="登录密码" />
                </div>
                <div class="layui-block">
                    <button type="button" class="layui-btn layui-btn-big login-btn" lay-submit lay-filter="login">登 录</button>
                </div>
            </form>
        </div>
    </div>


</div>


{include file="layout/footerJs.html"}
{literal}<script>
    layui.use(['jquery', 'layer', 'form'], function($){
        var layer = layui.layer;
        var form = layui.form();

        $('input[name="password"]').focus(function () {
            $(".login-logo").addClass("password");
        }).stop();
        $('input[name="password"]').blur(function () {
            $(".login-logo").removeClass("password");
        }).stop();

        //表单验证规则
        form.verify({
             username: function(v){
                if(v == '') {
                    return '用户名不能为空';
                }
             },
             password: function(v){
                if(v == '') {
                    return '密码不能为空';
                }
             }
        }).on('submit(login)', function(data){
            $.ajax({
                data: data.field,
                dataType: 'text',
                type: 'post',
                url: '/login/signIn',
                success: function(msg){
                    if(msg == ''){
                        layer.msg('用户名或密码错误');
                    }else{
                        window.location.href = msg;
                    }
                }
            });
            return false;
        });
    });
</script>{/literal}
</body>
</html>